package co.yixiang.hw.rest;

import co.yixiang.annotation.AnonymousAccess;
import co.yixiang.hw.service.YxSystemFuncShieldService;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

/**
* @author Walert
* @date 2020-02-25
*/
@Api(tags = "版本功能接口API管理")
@RestController
@RequestMapping("/api/yxSystemFuncShield")
public class YxSystemFuncShieldController {

    private final YxSystemFuncShieldService yxSystemFuncShieldService;

    public YxSystemFuncShieldController(YxSystemFuncShieldService yxSystemFuncShieldService) {
        this.yxSystemFuncShieldService = yxSystemFuncShieldService;
    }

    @ApiOperation("查询版本功能接口API")
    @AnonymousAccess
    @PostMapping(value = "/fetch")
    public ResponseEntity<Object> getYxSystemFuncShields(@RequestBody JSONObject params){
        String version = params.getString("version");
        return new ResponseEntity<>(yxSystemFuncShieldService.findByVersionNum(version),HttpStatus.OK);
    }

}